char *pHttpPost = "POST %s HTTP/1.1\r\n"
    "Host: %s:%d\r\n"
    "Content-Type: application/x-www-form-urlencoded\r\n"
    "Content-Length: %d\r\n\r\n"
    "%s";

string addr = "http://localhost/post.php";
string host = "127.0.0.1";
int port = 80;
string msg = "aaa=1&bbb=2";

char strHttpPost[1024] = {0};
sprintf(strHttpPost, pHttpPost, addr, host, port, strlen(msg), msg);

//这里忽略掉了socket连接代码

send(sockClient, strHttpPost, strlen(strHttpPost), 0);
